package com.munhrasoft.dinamica.business.entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;

@Entity
@NamedQueries(value = {
		@NamedQuery(name = "findAllProcuradores", query = "SELECT proc FROM Procurador proc"),
		@NamedQuery(name = "findProcuradorByNome", query = "SELECT proc FROM Procurador proc WHERE lower(proc.nome) "
				+ "LIKE :nome") })
@SequenceGenerator(name = "procuradorSeq", initialValue = 1, allocationSize = 1)
public class Procurador {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "procuradorSeq")
	private Long id_procurador;
	private String nome;
	private String cpf;
	private String email;
	private String telResidencial;
	private String telCelular;
	
	@Override
	public boolean equals(Object obj) {
		if (this.getId_procurador() == ((Procurador) obj).getId_procurador()) {
			return true;
		} else {
			return false;
		}
	}

	public Long getId_procurador() {
		return id_procurador;
	}

	public void setId_procurador(Long id_procurador) {
		this.id_procurador = id_procurador;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getCpf() {
		return cpf;
	}

	public void setCpf(String cpf) {
		this.cpf = cpf;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTelResidencial() {
		return telResidencial;
	}

	public void setTelResidencial(String telResidencial) {
		this.telResidencial = telResidencial;
	}

	public String getTelCelular() {
		return telCelular;
	}

	public void setTelCelular(String telCelular) {
		this.telCelular = telCelular;
	}

}
